package com.banmao.desktoptools.util;

import javafx.fxml.FXMLLoader;
import javafx.scene.Node;

import java.io.IOException;
import java.net.URL;

public class FXMLUtil {

    public static Node loadFxml(String fxmlPath) throws IOException {
        URL url = FXMLUtil.class.getResource(fxmlPath);
        if(url != null) {
            FXMLLoader fxmlLoader = new FXMLLoader(url);
            Node node = fxmlLoader.load();
            return node;
        }
        return null;
    }

}
